# -*- mode: python ; coding: utf-8 -*-

import sys
from pathlib import Path

block_cipher = None

a = Analysis(
    ['src\\main.py'],
    pathex=['src'],  # 添加源码路径
    binaries=[],
    datas=[],
    hiddenimports=[],
    hookspath=['.\\src\\'],  # 指定 hook 路径
    hooksconfig={},
    runtime_hooks=[],
    excludes=[],
    win_no_prefer_redirects=False,
    win_private_assemblies=False,
    cipher=block_cipher,
    noarchive=False,
)

# 添加运行时钩子以确保 asyncio 正常工作
a.binaries = a.binaries
a.datas = a.datas
a.zipfiles = a.zipfiles
a.pure = a.pure

pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)

exe = EXE(
    pyz,
    a.scripts,
    a.binaries,
    a.zipfiles,
    a.datas,
    name='edge-tts',
    debug=False,
    bootloader_ignore_signals=False,
    strip=False,
    upx=True,  # 使用 UPX 压缩
    upx_exclude=[],
    runtime_tmpdir=None,
    console=True,  # 如果是命令行工具
    disable_windowed_traceback=False,
    argv_emulation=False,
    target_arch=None,
    codesign_identity=None,
    entitlements_file=None,
    onefile=True,  # 打包为单个文件
    icon=['logo.ico'],  # 可以添加图标路径
)